﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Cofe.Core.Security;

namespace Cofe.Core.Validater
{
    /// <summary>
    /// Require certain permission to access a property or invoke an action or task.
    /// </summary>
    public class RequirePermissionAttribute : Attribute
    {
        public RequirePermissionAttribute(PermissionType permissionTypeRead, PermissionType permissionTypeWrite)
        {
            PermissionTypeForRead = permissionTypeRead;
            PermissionTypeForWrite = permissionTypeWrite;
        }

        public RequirePermissionAttribute(PermissionType permissionTypeRead)
        {
            PermissionTypeForRead = permissionTypeRead;
            PermissionTypeForWrite = PermissionType.Write;
        }

        public PermissionType PermissionTypeForRead { get; private set; }
        public PermissionType PermissionTypeForWrite { get; private set; }
    }
}
